package per.turtle.system.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import per.turtle.common.core.constant.ServiceNameConstants;
import per.turtle.common.core.web.entity.CommonResult;
import per.turtle.common.core.web.page.TableDataInfo;
import per.turtle.system.entity.SysRole;
import per.turtle.system.feign.factory.RemoteRoleFallbackFactory;

/**
 * 用户服务
 *
 * @author turtle
 */
@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteRoleFallbackFactory.class)
public interface RemoteRoleService {

    /**
     * 根据角色id获取角色信息
     *
     * @param roleId 角色id
     * @return 结果
     */
    @GetMapping("role/{roleId}")
    CommonResult<SysRole> selectRoleById(@PathVariable String roleId);

    /**
     * 获取角色列表或分页
     *
     * @param role 用户信息
     * @return 结果
     */
    @PostMapping("role/list")
    TableDataInfo<SysRole> selectRoleList(@RequestBody SysRole role);

}
